
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:work_tools/config/config.dart';

class AddWhitelistState {
  String redisKey = "";
  String redisValue = "";
  var newValue = "";
  final node = FocusNode();

  String get keyZh {
    if (redisKey == AppConfig.vinRedisKey) return "VIN码";
    if (redisKey == AppConfig.mobileRedisKey) return "手机号";
    return "";
  }
  List<TextInputFormatter>? get inputFormatters {
    if (redisKey == AppConfig.mobileRedisKey) {
      return [FilteringTextInputFormatter.digitsOnly];
    }
    return null;
  }
  int get maxLength {
    if (redisKey == AppConfig.mobileRedisKey) return 11;
    return 20;
  }

}